package com.artinapp.storyteller.ui;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.artinapp.storyteller.R;

/**
 * A placeholder fragment containing a simple view.
 */
public class SplashActivityFragment extends BaseFragment {

    public SplashActivityFragment() {

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_splash, container, false);
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        Handler handler = new Handler() {
            @Override
            public void handleMessage(Message msg) {
                Intent intent = new Intent(getActivity(), StoryShelfActivity.class);
                getActivity().startActivity(intent);
                getActivity().finish();
                super.handleMessage(msg);
            }
        };
        handler.sendEmptyMessageDelayed(1, 3000);
    }
}
